package com.qf.service.impl;

import com.qf.dfa.SensitiveWordFilter;
import com.qf.dfa.SensitiveWordInit;
import com.qf.model.StandardSubmit;
import com.qf.service.FilterChainService;
import org.springframework.stereotype.Service;

/**
 * @author Zwnan
 */
@Service("dirtyWords")
public class DirtyWordFilterServiceImpl implements FilterChainService {

//"phase,black,limitFiveMinutes,dirtyWords,fee,router"
    @Override
    public boolean stratrgy(StandardSubmit submit) {

        SensitiveWordFilter instance = SensitiveWordFilter.getInstance();
        int i = instance.checkSensitiveWord(submit.getMessageContent(), 0, SensitiveWordFilter.minMatchType);
        if (i>0){
            return false;
        }else {
            return true;
        }


    }
}
